<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setAttribute("basePath", basePath);
%>
<script type="text/javascript">
	$(document).ready(function(){
		$('#w').window('close');
		$('#t1').datagrid({singleSelect:(this.value==1)});
		$('#t2').datagrid({singleSelect:(this.value==1)});
		$('#t3').datagrid({singleSelect:(this.value==1)});
		$('#t4').datagrid({singleSelect:(this.value==1)});
		$('#t5').datagrid({singleSelect:(this.value==1)});
		$('#t6').datagrid({singleSelect:(this.value==1)});
	});
	
	var array = ['#t1', '#t2', '#t3', '#t4', '#t5', '#t6'];
	
	function clearSelects(exclude){
		for(var i=0;i<array.length;i++){
			if(array[i] != exclude){
				$(array[i]).datagrid('unselectAll');
			}
        }
	}
	
	function getSelectedServers(){
		var result = [];
		for(var i=0; i< array.length;i++){
			var tempArray = $(array[i]).datagrid('getChecked');
			result = result.concat(tempArray);
		}
		return result;
	}
	function submitForm() {
		$('#ff').submit();
	}
</script>
<form id="chooseGMServer" action="#" method="post" entyctype="text/plain">
	<table id="t1" title="选择需要更新久游服务器" style="width: 100%; height: 300px"
		data-options="rownumbers:true,singleSelect:true,autoRowHeight:true,pagination:true,pageSize:10, url:'<%=basePath%>GetGMServersServlet?plat=0',method:'get',singleSelect:true">
		<thead>
			<tr>
				<th data-options="field:'ck',checkbox:true"></th>
				<th data-options="field:'serverId',width:50">id</th>
				<th data-options="field:'serverName',width:80">服务器名</th>
			</tr>
		</thead>
	</table>
	<table id="t2" title="选择需要更新360服务器" style="width: 100%; height: 300px"
		data-options="rownumbers:true,singleSelect:true,autoRowHeight:true,pagination:true,pageSize:10, url:'<%=basePath%>GetGMServersServlet?plat=1',method:'get',singleSelect:true">
		<thead>
			<tr>
				<th data-options="field:'ck',checkbox:true"></th>
				<th data-options="field:'serverId',width:50">id</th>
				<th data-options="field:'serverName',width:80">服务器名</th>
			</tr>
		</thead>
	</table>
	<table id="t3" title="选择需要更新大挂武林服务器" style="width: 100%; height: 300px"
		data-options="rownumbers:true,singleSelect:true,autoRowHeight:true,pagination:true,pageSize:10, url:'<%=basePath%>GetGMServersServlet?plat=2',method:'get',singleSelect:true">
		<thead>
			<tr>
				<th data-options="field:'ck',checkbox:true"></th>
				<th data-options="field:'serverId',width:50">id</th>
				<th data-options="field:'serverName',width:80">服务器名</th>
			</tr>
		</thead>
	</table>
	<table id="t4" title="选择需要更新武林外挂服务器" style="width: 100%; height: 300px"
		data-options="rownumbers:true,singleSelect:true,autoRowHeight:true,pagination:true,pageSize:10, url:'<%=basePath%>GetGMServersServlet?plat=3',method:'get',singleSelect:true">
		<thead>
			<tr>
				<th data-options="field:'ck',checkbox:true"></th>
				<th data-options="field:'serverId',width:50">id</th>
				<th data-options="field:'serverName',width:80">服务器名</th>
			</tr>
		</thead>
	</table>
	<table id="t5" title="选择需要更新云顶IOS越狱版服务器" style="width: 100%; height: 300px"
		data-options="rownumbers:true,singleSelect:true,autoRowHeight:true,pagination:true,pageSize:10, url:'<%=basePath%>GetGMServersServlet?plat=4',method:'get',singleSelect:true">
		<thead>
			<tr>
				<th data-options="field:'ck',checkbox:true"></th>
				<th data-options="field:'serverId',width:50">id</th>
				<th data-options="field:'serverName',width:80">服务器名</th>
			</tr>
		</thead>
	</table>
	<table id="t6" title="选择需要更新ios触乐服务器" style="width: 100%; height: 300px"
		data-options="rownumbers:true,singleSelect:true,autoRowHeight:true,pagination:true,pageSize:10, url:'<%=basePath%>GetGMServersServlet?plat=5',method:'get',singleSelect:true">
		<thead>
			<tr>
				<th data-options="field:'ck',checkbox:true"></th>
				<th data-options="field:'serverId',width:50">id</th>
				<th data-options="field:'serverName',width:80">服务器名</th>
			</tr>
		</thead>
	</table>
</form>

